<!DOCTYPE html>
<html lang="en-us">
<head>
	<meta charset="utf-8">
	<title> 添加自动化用例  </title>
	
	<link rel="stylesheet" type="text/css" media="screen" href="css/common.css">
	<link rel="stylesheet" type="text/css" media="screen" href="css/bootstrap.min-3.2.0.css">
	<link rel="stylesheet" type="text/css" media="screen" href="css/bootstrap.modify.css">
	<link rel="stylesheet" type="text/css" media="screen" href="css/expand.css">
	<link rel="stylesheet" type="text/css" media="screen" href="css/font-awesome.min.css">
		<link rel="stylesheet" type="text/css" media="screen" href="css/smartadmin-production.css">
		<link rel="stylesheet" href="css/bootstrap-select.css">
	<link rel="stylesheet" type="text/css" media="screen" href="css/smartadmin-skins.css">
		<link rel="stylesheet" type="text/css" media="screen" href="css/demo-increase.css">
		<link rel="stylesheet" href="css/bootstrapValidator.min.css" />
		
    <link rel="stylesheet" type="text/css" href="css/manhuaTip.1.0.css">
   	<style type="text/css">
	   	body{
			font-family: "Microsoft YaHei",微软雅黑,Arial,Helvetica,sans-serif;
		}
		td, th {
			padding: 1px;
		}
   		.bootstrap-select > .btn{
	    	height: 30px;
	    }
		.separator {
		    border-left: 1px solid #a8a8a8;
		}
		.separator {
		    -moz-border-bottom-colors: none;
		    -moz-border-left-colors: none;
		    -moz-border-right-colors: none;
		    -moz-border-top-colors: none;
		    border-color: -moz-use-text-color -moz-use-text-color -moz-use-text-color #adb3b9;
		    border-image: none;
		    border-style: none none none solid;
		    border-width: 0 0 0 1px;
		    display: inline-block;
		    height: 18px;
		    margin: 0 8px 1px;
		    vertical-align: middle;
		}
		.icon-add {
		    background: url("img/add.gif") no-repeat scroll 0 0 rgba(0, 0, 0, 0);
		}
		#addInterface .has-feedback .form-control{
			padding-right: 12px;
		}
		#addInterface .form-control-feedback {
			width: 15px;
 		}
 		table{
 			table-layout: fixed;
 		}
 		td{
 			word-WRAP: break-word;
 		}
 		.not_Empty_td{
 			background:   none repeat scroll 0 0 #fee2f0  !important;
 		}	
 		.showinfo{
			  display:none;
			  left:1px;
			  top:1px;
			  padding:5px;
			  color:red;
			  position:fixed; 
			  z-index:999999; 
			  border: 1px solid #5e4e3f;
 		}
		#showinfo2{
			  display:none;
			  left:1px;
			  top:1px;
			  padding:5px;
			  position:fixed; 
			  z-index:999999; 
			  max-width:200px;
			  word-break:break-all;
			  border: 1px solid #5e4e3f;
 		}
 		a.assert-details {
 			max-width:220px;
		    text-overflow:ellipsis;
		    white-space:nowrap;
		    overflow:hidden;
 		}
		.license-required::after {
		    color: #006cab !important;
		    content: "";
		    display: block;
		    font-family: artifactory !important;
		    font-size: 16px;
		    position: absolute;
		    right: 5px;
		    top: 0;
		    width: 20px;
		}
		#selectIconDiv{
		 background: none repeat scroll 0 0 #ccdadf;
	    border: 2px solid #c2c2c2;
	    color: #2b363c;
	    left: 0;
	    line-height: 18px;
	    position: fixed;
	    top: 0;
	    width: 100%;
	    z-index: 999;
		}
		#selectIconDiv  a {
			margin-left: 5px;
			margin-top: 2px;
		}
		.smart-form section.selectLevel {
		    margin-bottom: 0px;
		}
   	</style>
	<script type="text/javascript">
	</script>
</head>
<body id="addAutoCase">

<section id="widget-grid" class="">
	<!-- row -->

	<div class="row" id="allTaskBox">
		<div style="background: none repeat scroll 0 0 #fafafa;padding-left: 10px">
		<div class="col col-sm-6 col-xs-6">
		<a id="prevPage" class="btn btn-default widget-section-link" langlanguage="back" href="autog7.html">返回</a>
		</div>
		<div class="col col-sm-6 col-xs-6"> </div>
		</div>
		<!-- NEW WIDGET START -->
			<article class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
				<!-- Widget ID (each widget will need unique ID)-->
				<div class="jarviswidget jarviswidget-color-blueLight" id="wid-id-0" data-widget-sortable="true" data-widget-colorbutton="false" data-widget-editbutton="false" data-widget-togglebutton="false" data-widget-deletebutton="false" style="min-height:500px">
					<!-- widget div-->
					<div role="content">
						<!-- widget edit box -->
						<div class="jarviswidget-editbox">
							<!-- This area used as dropdown edit box -->
						</div>
						<!-- end widget edit box -->
						<!-- widget content -->
						<div class="widget-body no-padding">
							<!-- 自定义搜索区 -->
							<div class="widget-body-toolbar" >
								<div role="form" class="smart-form">
									<div class="pull-left global-search-box2">
										<!-- <div style="float: left;width: 100%">											
											<div style="float: left">工程路径:</div>
											<div style="float: left;margin:0px 5px 0px 5px;">
													<label class="input">
															<input id="jobpath" type="text" placeholder="" class="input-sm">
													</label>
											</div>
											<div style="float: left;margin:0px 5px 0px 5px;">
													
													<input id="importjob" class="btn btn-primary btn-sm" type="button" onclick="importjob();" value="导入工程">
													
											</div>	
										</div> --> 										
										<div>
										<div style="float:left">
											<section class="pull-left no-padding col" >
												<label class="">选择接口</label>
												
												<label class="form-group select">
													<select id="interface" class="input-sm" style="width:100%;max-width: 300px;">
														  <!-- <option value =""  selected="selected"></option>
														  <option value ="huoyunren.gpsevent.currents" >huoyunren.gpsevent.currents</option>
														  <option value ="huoyunren.gpsevent.getMileage" >huoyunren.gpsevent.getMileage</option>
														  <option value="" onclick="$('#myModal').modal();">添加</option> -->
													</select>
													<i></i>
												</label>										
	                                        </section>                                       
										</div> 
										<div style="float:left">
											<section class="pull-left no-padding col pull-width140" >
												<label class="">运行环境</label>
												<label class="select">
												<select id="environment" name="environment" class="input-sm" style="width:100%;max-width: 200px;" onchange="showModules(this);">
												</select>
												<i></i>
												</label>
	                                        </section>
										</div> 											
								  		<div style="float:left">
											<section class="pull-left no-padding col" >
												<label class="">URL地址</label>											
												<label class="input">
													<input id="URL" class="input-sm" type="text" placeholder="" name="URL" disabled="disabled" style="width: 300px">
												</label>
	                                        </section>
										</div> 	
										<div style="float:left">
											<section class="pull-left no-padding col pull-width140" >
												<label class="">接口类型</label>
												
												<label class="select">
												<select id="intertype" class="input-sm" style="width:100%;max-width: 200px;" onchange="selectintertype();">
												  <option value ="DSP" selected="selected">DSP接口</option>
												  <option value ="other">其他接口</option>
												</select>
												<i></i>
												</label>
	                                        </section>
										</div> 			
										<div style="float:left">
											<section class="pull-left no-padding col pull-width140" >
												<label class="">重要程度</label>
												
												<label class="select">
												<select id="degree" class="input-sm" style="width:100%" onchange="">
												  <option value=1  selected="selected">v1(高)</option>
												  <option value=2 >v2(中)</option>
												  <option value=3 >v3(低)</option>
												</select>
												<i></i>
												</label>
	                                        </section>
										</div> 	
										<div style="float:left">
											<section class="pull-left no-padding col pull-width140" >
												<label class="">业务模块</label>
												
												<label class="select">
												<select id="module" class="input-sm" style="width:100%" onchange="">
												</select>
												<i></i>
												</label>
	                                        </section>
										</div> 
										<div style="float:left">
											<section class="pull-left no-padding col pull-width140" >
												<label class="">负责人</label>
												
												<label class="select">
												<select id="tester" class="input-sm" style="width:100%" onchange="">
												  <option value ="duanxiangyun"  selected="selected">段祥云</option>
												  <option value ="huangyu" >黄宇</option>
												  <option value ="lanji" >兰基</option>
												  <option value ="liuchi" >刘驰</option>
												  <option value ="xiezhenyu" >谢震宇</option>
												  <option value ="xiejie" >谢杰</option>
												  <option value ="jiangyan" >江艳</option>
												  <option value ="yuyanfei" >于艳飞</option>
												  <option value ="liuhao" >刘浩</option>
												  <option value ="xiongruili" >熊锐莉</option>
												  <option value ="zengyu" >曾玉</option>
												</select>
												<i></i>
												</label>
	                                        </section>
										</div>
										<div style="float:left">
											<section class="pull-left no-padding col pull-width140" >
												<label class="">请求方式</label>
												
												<label class="select">
												<select id="requestType" class="input-sm" style="width:100%" onchange="">
												  <option value ="POST" selected="selected">-POST-</option>
												  <option value ="GET" >-GET-</option>
												</select>
												<i></i>
												</label>
	                                        </section>
	                                       <input type="hidden" name="sumidHide" id="sumidHide">
										</div>
										</div>							
										
								</div>
							</div>
							<div class="row no-margin margin-top-10 margin-bottom-10"> </div>
							<div id="params">
							
							</div>
							<div id="funcselectionDiv" style="margin-bottom: 5px">
							<a id="paramFuc" dragtype="paramsfuction" class="btn btn-warning"  type="button" draggable="true" ondragstart="drag(event)">取值函数</a>
							<a id="assertFuc" dragtype="assertfuction" class="btn btn-warning"  type="button" draggable="true" ondragstart="drag(event)">断言函数</a>							
							</div>
							<div style="border:2px solid lightgrey">
								<font style="float: left;" size="3">统一参数&nbsp;&nbsp;:&nbsp;&nbsp;</font>
								<div id="hideouter" style="display: none;">
									<font color="red">获取每次接口入参的json串&nbsp;&nbsp;&nbsp;:&nbsp;&nbsp;&nbsp;${jsonParams}</font>
									<input id="addrowkey" class="btn btn-primary btn-sm" type="button" onclick="addparams();" value="添加">	
								</div>	
								
								<div id="dsp_keyandsecret">
									<div style="clear:both;"></div>
									<div style="float:left"><label>app_key&nbsp;&nbsp;:&nbsp;&nbsp;</label>	</div>
									<div style="float:left">											
										<input id="app_key" class="form-control" type="text" value="bc7e94">
									</div>
									<div style="float:left"><label>&nbsp;&nbsp;secret&nbsp;&nbsp;:&nbsp;&nbsp;</label></div>									
									<div style="float:left">													
										<input id="secret" class="form-control" type="text" value="88DA9E321AF1B146B758460D5D0697F8">
									</div>
									<p></p>	
								</div>
								<div id="hidedata" style="display: none;">
								<table id="param_tb"  style="width: 100%">
								<tr>
									<td style="width: 8%;float:left;">
									<input class="form-control urlparam_key" type="text" value="app_key">
									</td>
									<td align="center" style="width: 1%;float:left;">:</td>
									<td style="width: 8%;float:left;">
									<input id="param_appkey" dragtype="paramsfuction" ondrop="drop(event);" ondragover="allowDrop2(event);" class="form-control urlparam_value" type="text" value="bc7e94">
									</td>
									<td align="center" style="width: 1%;float:left;">
									<a onclick="deleteparam(this);" href="####">
									<img width="100%" height="100%" border="0" src="img/delete.gif">
									</a>
									</td>
									<td align="center" style="width: 2%;float:left;">|</td>
									<td style="width: 8%;float:left;">
									<input class="form-control urlparam_key" type="text" value="method">
									</td>
									<td align="center" style="width: 1%;float:left;">:</td>
									<td id="method_value" style="width: 8%;float:left;">
									<input dragtype="paramsfuction" ondrop="drop(event);" ondragover="allowDrop2(event);" class="form-control urlparam_value" type="text" value="">
									</td>
									<td align="center" style="width: 1%;float:left;">
									<a onclick="deleteparam(this);" href="####">
									<img width="100%" height="100%" border="0" src="img/delete.gif">
									</a>
									</td>
									<td align="center" style="width: 2%;float:left;">|</td>
									<td style="width: 8%;float:left;">
									<input class="form-control urlparam_key" type="text" value="timestamp">
									</td>
									<td align="center" style="width: 1%;float:left;">:</td>
									<td style="width: 8%;float:left;">
									<input dragtype="paramsfuction" ondrop="drop(event);" ondragover="allowDrop2(event);" class="form-control urlparam_value" type="text" value="now()">
									</td>
									<td align="center" style="width: 1%;float:left;">
									<a onclick="deleteparam(this);" href="####">
									<img width="100%" height="100%" border="0" src="img/delete.gif">
									</a>
									</td>
									<td align="center" style="width: 2%;float:left;">|</td>	
									<td style="width: 8%;float:left;">
									<input class="form-control urlparam_key" type="text" value="sign">
									</td>
									<td align="center" style="width: 1%;float:left;">:</td>
									<td style="width: 8%;float:left;">
									<input id="param_sign" dragtype="paramsfuction" ondrop="drop(event);" ondragover="allowDrop2(event);" class="form-control urlparam_value" type="text" value="sign2(appkey,method,format,timestamp,${jsonParams},88DA9E321AF1B146B758460D5D0697F8)">
									</td>
									<td align="center" style="width: 1%;float:left;">
									<a onclick="deleteparam(this);" href="####">
									<img width="100%" height="100%" border="0" src="img/delete.gif">
									</a>
									</td>
									<td align="center" style="width: 2%;float:left;">|</td>
									<td style="width: 8%;float:left;">
									<input class="form-control urlparam_key" type="text" value="format">
									</td>
									<td align="center" style="width: 1%;float:left;">:</td>
									<td style="width: 8%;float:left;">
									<input dragtype="paramsfuction" ondrop="drop(event);" ondragover="allowDrop2(event);" class="form-control urlparam_value" type="text" value="json">
									</td>
									<td align="center" style="width: 1%;float:left;">
									<a onclick="deleteparam(this);" href="####">
									<img width="100%" height="100%" border="0" src="img/delete.gif">
									</a>
									</td>					
								</tr>
								</table>
								</div>
								<div style="clear:both;"></div>						
							</div>
							<p></p>
							<div style="border:2px solid lightgrey">
								<font style="float: left" size="3">接口场景&nbsp;&nbsp;:&nbsp;&nbsp;</font><div id="hiddeUrlToParam" style="display: none;"><font color="red">接口入参是否依次作为url参数传入?<input id="dataAsUrlparam" type="checkbox" checked="checked" /></div></font>
								<div style="clear:both;"></div>	
								<div class="row padding-10">
									<div class="col-xs-8 col-sm-8">
										<div class="btn-group">
											<a onclick="addrow();" class="btn btn-default widget-section-link">新增</a>
											<a onclick="deleteInterfacedetails();" class="btn btn-default">删除</a>
										</div>
										<div class="btn-group">
											<a class="btn btn-default widget-section-link"  onclick="debugTest(getCases());">批量执行</a>
											<a class="btn btn-default" onclick="saveCase();">保存</a>
										</div>							
									</div>
								</div>	
								<div id="scroll_div" style="">
									<table id="dt_basic" class="table table-striped table-bordered table-hover has-tickbox" style="table-layout:fixed">
										<thead>
										<tr>
										<th aria-label="" style="width: 2%;text-align: center; white-space: nowrap;" colspan="1" rowspan="1" tabindex="0" class="sorting_disabled center"><label class="no-margin"><input name="checkbox style-0 " class="checkbox style-0 checkAll" id="checkAll" name="checkAll" type="checkbox"><span style="margin-right: 0px;"></span></label></th>
										<th style="width: 25%;text-align: center;"><label id="testparams">接口入参</label></th>
										<th style="width: 5%;text-align: center;"><label id="expectcode">预期code</label></th>
										<th style="width: 10%;text-align: center;"><label id="expectmessage">预期message</label></th>
										<th style="width: 30%;text-align: center;"><label id="assertresult">结果断言</label></th>
										<th style="width: 5%;text-align: center;" ><label id="expectnum">期望条数</label></th>
										<th style="width: 5%;text-align: center;" ><label id="testlevel">level</label></th>
										<th style="width: 10%;text-align: center;"><label id="testdetails">描述</label></th>
										<th style="width: 5%;text-align: center;"><label id="debug">运行</label></th>
										<th style="width: 3%;text-align: center;"><label id="result"></label></th>
										</tr>
										</thead>
										<tbody id="tbody"> </tbody>
									</table>
								</div>					
							</div>						
							<!-- <div class="dt-row dt-bottom-row">
								<div class="row">
									<div class="col-sm-1">
										<div id="dt_basic_length" class="dataTables_length">
											<span class="smart-form"> <label class="select"
												style="width: 60px"> 
												<select size="1" id="dt_row" name="dt_basic_length" aria-controls="dt_basic">
														<option value="100" selected="selected">100</option>
														<option value="200">200</option>
														<option value="500">500</option>
												</select> <i> </i>
											</label>
											</span>
										</div>
									</div>
									
									<div class="col-sm-4">
										<div class="dataTables_info" id="dt_basic_info">
										
										</div>
									</div>
									<div class="col-sm-7 text-right">
										
										<div class="dataTables_paginate paging_bootstrap_full" style="float:right">
											<ul class="pagination">
												<li class="prev"><a href="#">前一页</a></li>
												<li class="next"><a href="#">后一页</a></li>
												<li class="first disabled"><a href="#">首页</a></li>
												<li class="prev disabled"><a href="#">前一页</a></li>
												<li value=1><a href="#">1</a></li>
												<li class="active" value=2><a href="#">2</a></li>
												<li class="next disabled"><a href="#">后一页</a></li>
												<li class="last disabled"><a href="#">尾页</a></li>
											</ul>
										</div>
										<div id="reach_end" style="display:none;float:right;width:20%;margin-top:12px;margin-right:5px;color:red" >
											已到达最后一页
										</div>
										
									</div>
								</div>
							</div> -->

						
						</div>
						
						<!-- end widget content -->
					</div>
					<!-- end widget div -->
				</div>
				<!-- end widget -->
			</article>
		<!-- WIDGET END -->

	</div>

	<!-- end row -->

	<!-- end row -->
	<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	    <div class="modal-dialog">
	        <div class="modal-content">
	            <div class="modal-header">
	                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
	                    ×
	                </button>
	                <h4 class="modal-title" id="myModalLabel" langlanguage="internalSharing">新增接口</h4>
	            </div>
	            <form id="Interface_Add_form">
	            	<div class="modal-body" id="Interface_Add">
		            	<div style="float: left;"><label>接口名:</label></div>
		            	<div class="form-group has-feedback has-error" style="width: 40%;float: left;"><input id="intername" class="form-control" type="text" name="intername"></div>
		            			<div class="row padding-10">
									<div class="col-xs-8 col-sm-8">
										<div class="btn-group">
											<a onclick="addInterfacedetails();" class="btn btn-default widget-section-link" >新增</a>
											<a onclick="delSelected($('#interface-add-table'));" class="btn btn-default" >删除</a>
										</div>						
									</div>
								</div>
		            	<table id="interface-add-table" class="table table-striped table-bordered table-hover has-tickbox" style="table-layout:fixed">
							<thead>
								<tr>
								<th class="sorting_disabled center" tabindex="0" rowspan="1" colspan="1" style="width: 5%;text-align: center; white-space: nowrap;" aria-label="">
								<label class="no-margin">
								<input id="checkAll" class="checkbox style-0 checkAll" type="checkbox" name="checkbox style-0 ">
								<span style="margin-right: 0px;"></span>
								</label>
								</th>
								<th class="validate_notEmpty" id="add_name" style="width:25%;text-align: center;">参数名</th>
								<th class="validate_notEmpty" id="add_necessary" style="width:10%;text-align: center;">必选</th>
								<th class="validate_notEmpty" id="add_type" style="width:15%;text-align: center;">类型</th>
								<th class="notValidate" id="add_details" style="width:50%;text-align: center;">说明</th>
								</tr>
							</thead>
							<tbody id="addInterface">
								<!-- <tr>
								<td align="center">
									<input type="checkbox">
								</td>
								<td ondblclick="ShowElement(this);">sadsads</td>
								<td ondblclick="ShowElement(this);">y</td>
								<td ondblclick="ShowElement(this);">integer</td>
								<td ondblclick="ShowElement(this);">部门编号,多个以','相隔</td>
								</tr>
								<tr>
								<td align="center"><input type="checkbox"></td>
								<td ondblclick="ShowElement(this);">sadsads</td>
								<td ondblclick="ShowElement(this);">y</td>
								<td ondblclick="ShowElement(this);">String</td>
								<td ondblclick="ShowElement(this);">部门编号,多个以','相隔SADAS撒的撒打算多撒多撒大所多撒大所大所大所多撒大声地撒撒大所多</td>
								</tr> -->
							</tbody>
						</table>
					</div>
				    
	                <div class="modal-footer">
	                	<input id="shareType" type="hidden">
						<button type="submit" class="btn btn-primary btn-sm" onclick="addInterface();
	                            return false;" langlanguage="save_adas">保存</button>
	                    <button type="submit" class="btn btn-default" data-dismiss="modal" langlanguage="cancel">取消</button>
	                </div>
	            </form>
	            
	        </div>
	    </div>
	</div>
</section>
<div class="showinfo">
 不能为空!
</div >
<div id="showinfo2">
</div >
<div id="selectIconDiv" style="display: none;">
	<div id="selectParamsDiv">
	
	</div>
	<div id="selectFunctionDiv" style="display: none;">
		<a id="paramFuc" class="btn btn-warning" ondragstart="drag(event)" draggable="true" type="button" dragtype="paramsfuction">取值函数</a>
		<a id="assertFuc" class="btn btn-warning" ondragstart="drag(event)" draggable="true" type="button" dragtype="assertfuction">断言函数</a>
	</div>
</div>
<!-- end widget grid -->
<!--================================================== -->

	<!-- PACE LOADER - turn this on if you want ajax loading to show (caution: uses lots of memory on iDevices)
	<script data-pace-options='{ "restartOnRequestAfter": true }' src="js/plugin/pace/pace.min.js"></script>-->

	<!-- Link to Google CDN's jQuery + jQueryUI; fall back to local -->
	<script src="js/libs/jquery-2.0.2.min.js"></script>
	<script>
		if (!window.jQuery) {
			document.write('<script src="js/libs/jquery-2.0.2.min.js"><\/script>');
		}
	</script>

	<script src="js/libs/jquery-ui-1.10.3.min.js"></script>
	<script>
		if (!window.jQuery.ui) {
			document.write('<script src="js/libs/jquery-ui-1.10.3.min.js"><\/script>');
		}
	</script>
	<!-- BOOTSTRAP JS -->
	<script src="js/bootstrap/bootstrap.min-3.2.0.js"></script>
	<script type="text/javascript" src="js/bootstrapValidator.min.js"></script>
	<script>
     
	$(document).ready(function() {
		$("#interface").change(function () {  
		    getParams1(this);
	    }); 
		/* validata_addParams(); */
		$("#Interface_Add").bootstrapValidator({
		message : 'This value is not valid',
		feedbackIcons : {
			valid : 'glyphicon glyphicon-ok',
			invalid : 'glyphicon glyphicon-remove',
			validating : 'glyphicon glyphicon-refresh'
		},
		fields : {
			intername : {
				message : '请输入参数名',
				validators : {
					notEmpty : {
						message : '不能为空'
					},
					stringLength : {
						max : 100,
						message : '长度不能超过100个字节'
					},
					regexp : {
						regexp : /^[a-zA-Z0-9._]+$/,
						message : '用户名只能由字母、数字、点(.)和下划线(_)组成'
					},
				}
			},
		}
		})
	});
	</script>
	<script src="js/common.js"></script>
	<script src="js/bootstrap/bootstrap-select.js"></script>
	<script src="js/autog7.js"></script>
	<script src="js/autog7update.js"></script>	
	<script src="/js/app.js"></script>
	<script type="text/javascript"
		src="/js/plugin/iresizer/iframeResizer.contentWindow.min.js"></script>
	<script src="/js/plugin/date/moment.js"></script>
	<script src="/js/plugin/date/daterangepicker.js"></script>
	<script src="js/jquery.cookie.js"></script>
</body>

</html>
